﻿<%@ Page Title="" Language="C#" MasterPageFile="../../MasterPage.Master" AutoEventWireup="true" CodeBehind="ICM_Collect_Request.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Form.ICM_Collect_Request" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" tagprefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript" src="../../Scripts/Common.js"></script>
        <script type="text/javascript">
            function onTextChangeGeneral(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
            }

            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;
            }
            function openWinCollect() {
                radopen('../Edit_Form/ICM_Collect_Request_Select.aspx', "rwCollect");
            }

            function SeqClick(seq, type) {
                if (type == "1") {
                    radopen('../Edit_Form/ICM_Collect_Request.aspx?Seq=' + seq, 'rwRequestDetail');
                }
                else {
                    radopen('../Edit_Form/ICM_Collect_Request_Urgent.aspx?Seq=' + seq, 'rwRequestDetail');
                }
            }

            function ExpandPersonal(sender, Args) {
                if (!sender._loaded) {
                    $find("<%=RadAjaxPanel1.ClientID %>").ajaxRequest();
                    sender._loaded = true;
                }
            }
            
            function CheckTabStrip(sender, Args) {
                var tabstrip = $find("<%=RadTabStrip1.ClientID %>");
                if (tabstrip.get_selectedTab().get_value() == "All") {
                    Args.set_cancel(true);
                }
            }

            function OnClientTabSelected(sender, eventArgs) {
                var tabstrip = $find("<%=RadTabStrip1.ClientID %>");
                var sliding = $find("<%=PaneSearchNormal.ClientID %>");
                var slidingCollect = $find("<%=PaneSearchCollect.ClientID %>");
                if (tabstrip.get_selectedTab().get_value() == "All") {
                    sliding.showTab();
                    slidingCollect.hideTab();
                }
                else {
                    sliding.hideTab();
                    slidingCollect.showTab();
                }
            }

            function loadSplitter(sender) {
                var sliding = $find("<%=PaneSearchNormal.ClientID %>");
                var slidingCollect = $find("<%=PaneSearchCollect.ClientID %>");
                sliding.showTab();
                slidingCollect.hideTab();
            }

            function closeRadWindow(sender, args) {
                $find("<%= RadManager1.ClientID %>").ajaxRequest('CloseWindow');
            }
            
            function closeRWCollect(sender, args) {
                $find("<%= RadManager1.ClientID %>").ajaxRequest('CloseWindowCollect');
            }
            
            Sys.Application.add_load(setFromCalendarTable);
            Sys.Application.add_load(setToCalendarTable);
                
            function setFromCalendarTable() {
                var tooltip = $find("<%= ToolTipFromDate.ClientID %>");
                var calendar = $find("<%= CalendarFromDate.ClientID %>");                       
                var fastNavigation = calendar._getFastNavigation();
                fastNavigation.OnToday =
                function()
                {
                    var today = new Date;
                    var date = [today.getFullYear(), today.getMonth()+ 1, today.getDate()];
                    calendar.selectDate(date, true);
                    fastNavigation.Popup.Hide();  
                    var all_date = date.toString().split(",");
                    var year = parseInt(all_date[0]) + 543;
                    var month = all_date[1];
                    var day = all_date[2];
                    if (day.length == 1) {
                        day = '0' + day;
                    }
                    if (month.length == 1) {
                        month = '0' + month;
                    }

                    var maskText = $find("<%= txtFromDate.ClientID %>");
                    maskText.set_value(day + month + year);
                    tooltip.hide();
                }
            }

            function OnFromDateClick(calendarInstance, args) {
                var tooltip = $find("<%= ToolTipFromDate.ClientID %>");
                var fastNavigation = calendarInstance._getFastNavigation();
                var date = args.get_renderDay().get_date().toString();
                var all_date = date.split(",");
                var year = parseInt(all_date[0]) + 543;
                var month = all_date[1];
                var day = all_date[2];
                if (day.length == 1) {
                    day = '0' + day;
                }
                if (month.length == 1) {
                    month = '0' + month;
                }

                var maskText = $find("<%= txtFromDate.ClientID %>");
                maskText.set_value(day + month + year);
                tooltip.hide();
            }
            
            function OnFromCalendarViewChanged(sender, step) {
                var year = parseInt(sender.FocusedDate[0]) + 543;
                var month = sender.FocusedDate[1];
                document.getElementById("<%= CalendarFromDate.ClientID %>" + "_Title").innerHTML = changeMonthNumberToName(month) + " " + year; 
            } 
            
            function setToCalendarTable() {
                var tooltip = $find("<%= ToolTipToDate.ClientID %>");
                var calendar = $find("<%= CalendarToDate.ClientID %>");                       
                var fastNavigation = calendar._getFastNavigation();
                fastNavigation.OnToday =
                function()
                {
                    var today = new Date;
                    var date = [today.getFullYear(), today.getMonth()+ 1, today.getDate()];
                    calendar.selectDate(date, true);
                    fastNavigation.Popup.Hide();  
                    var all_date = date.toString().split(",");
                    var year = parseInt(all_date[0]) + 543;
                    var month = all_date[1];
                    var day = all_date[2];
                    if (day.length == 1) {
                        day = '0' + day;
                    }
                    if (month.length == 1) {
                        month = '0' + month;
                    }

                    var maskText = $find("<%= txtToDate.ClientID %>");
                    maskText.set_value(day + month + year);
                    tooltip.hide();
                }
            }

            function OnToDateClick(calendarInstance, args) {
                var tooltip = $find("<%= ToolTipToDate.ClientID %>");
                var fastNavigation = calendarInstance._getFastNavigation();
                var date = args.get_renderDay().get_date().toString();
                var all_date = date.split(",");
                var year = parseInt(all_date[0]) + 543;
                var month = all_date[1];
                var day = all_date[2];
                if (day.length == 1) {
                    day = '0' + day;
                }
                if (month.length == 1) {
                    month = '0' + month;
                }

                var maskText = $find("<%= txtToDate.ClientID %>");
                maskText.set_value(day + month + year);
                tooltip.hide();
            }
            
            function OnToCalendarViewChanged(sender, step) {
                var year = parseInt(sender.FocusedDate[0]) + 543;
                var month = sender.FocusedDate[1];
                document.getElementById("<%= CalendarToDate.ClientID %>" + "_Title").innerHTML = changeMonthNumberToName(month) + " " + year; 
            } 
            
            function CollapsePane()
            {
                var slidingZone = $find("<%= SlidingZone1.ClientID %>");
                var panes = slidingZone.GetPanes();
                slidingZone.collapsePane(panes[1].get_id());
            }
            
            function CollapsePaneCollect()
            {
                var slidingZone = $find("<%= SlidingZone1.ClientID %>");
                var panes = slidingZone.GetPanes();
                slidingZone.collapsePane(panes[2].get_id());
            }            
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" Skin="Outlook">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager runat="server" ID="RadManager1" OnAjaxRequest="RadManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                    <telerik:AjaxUpdatedControl ControlID="RadMultipage1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnDisplay">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1"  />
                    <telerik:AjaxUpdatedControl ControlID="RadMultipage1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="PanelPaneSearchNormal"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnCancel">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadMultipage1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="PanelPaneSearchNormal"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnDisplay_Collect">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1"  />
                    <telerik:AjaxUpdatedControl ControlID="RadMultipage1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="PanelPaneSearchCollect"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnCancel_Collect">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadMultipage1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="PanelPaneSearchCollect"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Grid_All" />
                    <telerik:AjaxUpdatedControl ControlID="Grid_Select" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" 
    runat="server" Skin="Vista" Modal="true" KeepInScreenBounds="true" Style="z-index: 7001">
        <Windows>
            <telerik:RadWindow ID="rwCollect" runat="server" Height="545px" Width = "720px" Behaviors="Default" OnClientClose="closeRWCollect">
            </telerik:RadWindow>
            <telerik:RadWindow ID="rwRequestDetail" runat="server" Height="570px" Width = "1030px" Behaviors="Default" OnClientClose="closeRadWindow">
            </telerik:RadWindow>
            <telerik:RadWindow ID="rwDialogForward" runat="server" Height="330px" Width = "825px" Behaviors="Default" >
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    
    <asp:Panel ID="panelHidden" runat="server">
        <asp:HiddenField ID="hdSeq" runat="server" Value="" />
    </asp:Panel>
    
    <telerik:RadSplitter id="RadSplitter1" runat="server" height="460" width="1000" Skin="Office2007" OnClientLoaded="loadSplitter">
        <telerik:RadPane id="LeftPane" runat="server" width="22" Scrolling="None" Locked="true">
            <telerik:RadSlidingZone id="SlidingZone1" runat="server" width="22" ClickToOpen="true">
                <telerik:RadSlidingPane id="PanePersonal" title="ข้อมูลส่วนตัว" runat="server" width="265" IconUrl="../Image/General/user.gif" EnableDock="false" OnClientBeforeExpand="ExpandPersonal">
                    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" OnAjaxRequest="OnAjaxRequest">
                    </telerik:RadAjaxPanel>
                </telerik:RadSlidingPane>
                <telerik:RadSlidingPane id="PaneSearchNormal" title="กรองข้อมูล" runat="server" width="400" IconUrl="../Image/Tree/search.gif" EnableDock="false">
                    <asp:Panel ID="PanelPaneSearchNormal" runat="server">
                        <table width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="10px">
                                </td>
                                <td>
                                    <div class="bigModuleLeftTree">
                                        <div class="bigModuleBottomLeftTree">
                                            <div class="header-grid">
                                                <asp:Label ID="Label2" runat="server" Text="กรองข้อมูล"></asp:Label>
                                            </div>
                                            <asp:Panel CssClass="panelTree" ID="PanelSearchNormal" runat="server" ScrollBars="Auto">
                                                <table width="100%" class="font-label">
                                                    <tr>
                                                        <td width="50px">
                                                        </td>
                                                        <td width="100%">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width="130px">
                                                                        ประเภทปี :
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadComboBox CssClass="RadComboBox" runat="server" ID="cbYearType" AllowCustomText="true" ShowDropDownOnTextboxClick="true"
                                                                            Filter="Contains" DataTextField="Name" DataValueField="Seq" Width="150px" 
                                                                            EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." LoadingMessage="กำลังโหลดข้อมูล ..." MarkFirstMatch="false" 
                                                                            OnClientTextChange="onTextChangeGeneral">
                                                                        </telerik:RadComboBox>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="50px">
                                                        </td>
                                                        <td width="100%">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width="130px">
                                                                        ปี :
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadNumericTextBox ID="txtYear" Runat="server" Width="100px" Skin="Outlook" NumberFormat-GroupSeparator="" NumberFormat-DecimalDigits="0"></telerik:RadNumericTextBox>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="50px">
                                                        </td>
                                                        <td width="100%">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width="130px">
                                                                        วันที่ส่งเริ่มต้น :
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadMaskedTextBox ID="txtFromDate" runat="server" Mask=" ##/##/####" SelectionOnFocus="SelectAll" TextWithLiterals=" //" Width="75px"></telerik:RadMaskedTextBox>
                                                                        <asp:LinkButton ID="LinkButton1" runat="server" CssClass="LinkButton">
                                                                            <img alt="" src="../Image/Icon/Calendar.gif" style="border:0px;vertical-align:middle;" />
                                                                        </asp:LinkButton>
                                                                        <telerik:RadToolTip ID="ToolTipFromDate" runat="server" Animation="None" HideEvent="LeaveToolTip" Position="MiddleRight" ShowEvent="OnClick" Skin="Telerik" 
                                                                        TargetControlID="LinkButton1" Modal="true">
                                                                            <telerik:RadCalendar id="CalendarFromDate" runat="server" TitleFormat="MMMM yyyy" EnableMultiSelect="false" UseRowHeadersAsSelectors="false" UseColumnHeadersAsSelectors="false" DayCellToolTipFormat="dddd, dd MMMM, yyyy" NavigationPrevToolTip="เดือนก่อนหน้า" NavigationNextToolTip="เดือนถัดไป" FastNavigationNextToolTip="3 เดือนถัดไป" FastNavigationPrevToolTip="3 เดือนก่อนหน้า">
                                                                                <ClientEvents OnDateClick="OnFromDateClick" OnCalendarViewChanged="OnFromCalendarViewChanged"></ClientEvents>
                                                                                <FastNavigationSettings EnableTodayButtonSelection="true" TodayButtonCaption="ไปที่วันนี้" OkButtonCaption="เปลี่ยน" CancelButtonCaption="ยกเลิก" />
                                                                            </telerik:RadCalendar>
                                                                        </telerik:RadToolTip>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                    </td>
                                                                    <td>
                                                                        <asp:CustomValidator ID="ValFromDate" runat="server" ControlToValidate="txtFromDate" ErrorMessage="กรุณาระบุวันที่เริ่มให้ถูกต้อง" Display="Dynamic" ClientValidationFunction="validateDate"></asp:CustomValidator>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="50px">
                                                        </td>
                                                        <td width="100%">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width="130px">
                                                                        วันที่ส่งสิ้นสุด :
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadMaskedTextBox ID="txtToDate" runat="server" Mask=" ##/##/####" SelectionOnFocus="SelectAll" TextWithLiterals=" //" Width="75px"></telerik:RadMaskedTextBox>
                                                                        <asp:LinkButton ID="LinkButton2" runat="server" CssClass="LinkButton">
                                                                            <img alt="" src="../Image/Icon/Calendar.gif" style="border:0px;vertical-align:middle;" />
                                                                        </asp:LinkButton>
                                                                        <telerik:RadToolTip ID="ToolTipToDate" runat="server" Animation="None" HideEvent="LeaveToolTip" Position="MiddleRight" ShowEvent="OnClick" Skin="Telerik" 
                                                                        TargetControlID="LinkButton2" Modal="true">
                                                                            <telerik:RadCalendar id="CalendarToDate" runat="server" TitleFormat="MMMM yyyy" EnableMultiSelect="false" UseRowHeadersAsSelectors="false" UseColumnHeadersAsSelectors="false" DayCellToolTipFormat="dddd, dd MMMM, yyyy" NavigationPrevToolTip="เดือนก่อนหน้า" NavigationNextToolTip="เดือนถัดไป" FastNavigationNextToolTip="3 เดือนถัดไป" FastNavigationPrevToolTip="3 เดือนก่อนหน้า">
                                                                                <ClientEvents OnDateClick="OnToDateClick" OnCalendarViewChanged="OnToCalendarViewChanged"></ClientEvents>
                                                                                <FastNavigationSettings EnableTodayButtonSelection="true" TodayButtonCaption="ไปที่วันนี้" OkButtonCaption="เปลี่ยน" CancelButtonCaption="ยกเลิก" />
                                                                            </telerik:RadCalendar>
                                                                        </telerik:RadToolTip>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                    </td>
                                                                    <td>
                                                                        <asp:CustomValidator ID="ValToDate" runat="server" ControlToValidate="txtToDate" ErrorMessage="กรุณาระบุวันที่สิ้นสุดให้ถูกต้อง" Display="Dynamic" ClientValidationFunction="validateDate"></asp:CustomValidator>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <br />
                                                <div align="center">
                                                   <table>
                                                       <tr>
                                                            <td>
                                                                <asp:LinkButton ID="btnDisplay" runat="server" Text="แสดงข้อมูล" CausesValidation ="false"  CssClass="form-button" onclick="btnDisplay_Click" OnClientClick="CollapsePane();"></asp:LinkButton>
                                                            </td>
                                                            <td>
                                                                <asp:LinkButton ID="btnCancel" runat="server" Text="ยกเลิก" Visible="false" CausesValidation ="false"  CssClass="form-button" onclick="btnCancel_Click"></asp:LinkButton>
                                                            </td>
                                                       </tr>
                                                   </table>
                                                </div>
                                            </asp:Panel>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </telerik:RadSlidingPane>
                <telerik:RadSlidingPane id="PaneSearchCollect" title="กรองข้อมูล" runat="server" width="400" IconUrl="../Image/Tree/search.gif" EnableDock="false">
                    <asp:Panel ID="PanelPaneSearchCollect" runat="server">
                        <table width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="10px">
                                </td>
                                <td>
                                    <div class="bigModuleLeftTree">
                                        <div class="bigModuleBottomLeftTree">
                                            <div class="header-grid">
                                                <asp:Label ID="lblHeaderPurchaseType" runat="server" Text="กรองข้อมูล"></asp:Label>
                                            </div>
                                            <asp:Panel CssClass="panelTree" ID="PanelSearchCollect" runat="server" ScrollBars="Auto">
                                                <table width="100%" class="font-label">
                                                    <tr>
                                                        <td width="50px">
                                                        </td>
                                                        <td width="100%">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width="130px">
                                                                        รายการพัสดุที่รวบรวมได้ :
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadComboBox CssClass="RadComboBox" runat="server" ID="cbItemName" 
                                                                            AllowCustomText="true" ShowDropDownOnTextboxClick="true"
                                                                            Filter="Contains" DataTextField="Name" DataValueField="Seq" Width="190px"
                                                                            EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." 
                                                                            LoadingMessage="กำลังโหลดข้อมูล ..." MarkFirstMatch="false" 
                                                                            OnClientTextChange="onTextChangeGeneral" ZIndex="8001">
                                                                        </telerik:RadComboBox>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <br />
                                                <div align="center">
                                                   <table>
                                                       <tr>
                                                            <td>
                                                                <asp:LinkButton ID="btnDisplay_Collect" runat="server" Text="แสดงข้อมูล" CausesValidation ="false"  CssClass="form-button" onclick="btnDisplay_Collect_Click" OnClientClick="CollapsePaneCollect();"></asp:LinkButton>
                                                            </td>
                                                            <td>
                                                                <asp:LinkButton ID="btnCancel_Collect" runat="server" Text="ยกเลิก" Visible="false" CausesValidation ="false"  CssClass="form-button" onclick="btnCancel_Collect_Click"></asp:LinkButton>
                                                            </td>
                                                       </tr>
                                                   </table>
                                                </div>
                                            </asp:Panel>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </telerik:RadSlidingPane>
            </telerik:RadSlidingZone>
        </telerik:RadPane>
        <telerik:RadSplitBar id="RadSplitBar1" runat="server"></telerik:RadSplitBar>
        <telerik:RadPane id="PaneData" runat="server" Scrolling="None">
	        <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <div class="exampleWrapper">
                            <telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0" runat="server" MultiPageID="RadMultiPage1" Skin="Vista" CssClass="multiPage" AutoPostBack="True" CausesValidation="false" OnTabClick="RadTabStrip1_TabClick" OnClientTabSelected="OnClientTabSelected">
                                <Tabs>
                                    <telerik:RadTab runat="server" Text="แสดงทุกรายการ" Value="All" Selected="true">
                                    </telerik:RadTab>
                                    <telerik:RadTab runat="server" Text="แสดงเฉพาะรายการที่มีรายการพัสดุเหมือนกัน" Value="Select">
                                    </telerik:RadTab>
                                </Tabs>
                            </telerik:RadTabStrip>
                            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="pageView">
                                <telerik:RadPageView ID="RadPageView1" runat="server">
                                    <div class="bigModulePaneFull" align="left">
                                        <div class="bigModuleBottomPaneFull">
                                            <asp:Panel ID="panelHeader_All" runat="server">
                                                <div class="header-grid">
                                                    <asp:Label ID="lblHeaderList" runat="server" Text="แสดงรายการ"></asp:Label>
                                                </div>
                                            </asp:Panel>
                                            <asp:Panel CssClass="panelGrid" ID="panelGrid_All" runat="server" ScrollBars="Auto">
                                                <div align="Left">
                                                    <telerik:RadGrid CssClass="RadGrid" ID="Grid_All" runat="server" AllowFilteringByColumn="true"
                                                    AllowMultiRowSelection="True" AllowPaging="false" AllowSorting="True"
                                                    AutoGenerateColumns="False" EnableAJAX="True" 
                                                    GridLines="None" ShowStatusBar="false" Skin="Outlook" Width="95%"
                                                    OnItemCommand="Grid_AllCommand">
                                                        <MasterTableView GroupLoadMode="Client" AllowMultiColumnSorting="true" DataKeyNames="Seq" ClientDataKeyNames="Seq" Width="100%">
                                                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                            <GroupHeaderItemStyle HorizontalAlign="Left" />
                                                            <Columns>
                                                                <telerik:GridBoundColumn DataField="YearTypeDescr"
                                                                    GroupByExpression="YearTypeDescr Group By InfoYearType.Seq, Year" Groupable="true" Visible="false"
                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                    FilterControlWidth="100%" HeaderText="ประเภทปี" 
                                                                    UniqueName="YearTypeDescr">
                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="DateRequested"
                                                                    GroupByExpression="DateRequested Group By DateRequested" Groupable="true" Visible="false"
                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                    FilterControlWidth="100%" HeaderText="วันที่ส่งรายการ" 
                                                                    UniqueName="DateRequested" DataFormatString="{0:dd MMMM yyyy}">
                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="SendTime" FilterControlWidth="100%" Visible="false"
                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="เวลาส่ง" 
                                                                    UniqueName="SendTime" DataFormatString="{0:hh:mm}">
                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="InfoPprType.Name" 
                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                    FilterControlWidth="100%"
                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="ประเภทรายการ" 
                                                                    UniqueName="InfoPprType.Name">
                                                                    <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="InfoPurchaseType.Name" 
                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                    FilterControlWidth="100%"
                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="ประเภทจัดหา" 
                                                                    UniqueName="InfoPurchaseType.Name">
                                                                    <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="InfoJobSite.Name" 
                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                    FilterControlWidth="100%"
                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="หน่วยงาน" 
                                                                    UniqueName="InfoJobSite.Name">
                                                                    <HeaderStyle HorizontalAlign="Center" Width="200px" />
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridTemplateColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                                                                    DataField="Ref_no" FilterControlWidth="100%" SortExpression="Ref_no"
                                                                    HeaderText="เลขที่" ShowFilterIcon="false" UniqueName="Ref_no">
                                                                    <HeaderStyle HorizontalAlign="Center" Width="150px"/>
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                    <ItemTemplate>
                                                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#" onclick='<%# "SeqClick(" + Eval("Seq") + "," + Eval("InfoPprType.Seq") + ");" %>' Text='<%# Eval("Ref_no") %>'></asp:HyperLink>
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>
                                                                <telerik:GridTemplateColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                                                                    DataField="Name" FilterControlWidth="100%" SortExpression="Name"
                                                                    HeaderText="เรื่อง" ShowFilterIcon="false" UniqueName="Name">
                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                    <ItemTemplate>
                                                                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="#" onclick='<%# "SeqClick(" + Eval("Seq") + "," + Eval("InfoPprType.Seq") + ");" %>' Text='<%# Eval("Name") %>'></asp:HyperLink>
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>
                                                                <telerik:GridBoundColumn DataField="InfoYearType.Seq" 
                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoYearType.Seq" 
                                                                    Visible="false">
                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="InfoRecord.InfoStatus.Status" 
                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoRecord.InfoStatus.Status" Visible="false">
                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="Seq" 
                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="Seq" 
                                                                    Visible="false">
                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                </telerik:GridBoundColumn>
                                                            </Columns>
                                                        </MasterTableView>
                                                        <ClientSettings EnableRowHoverStyle="true" >
                                                            <Selecting AllowRowSelect="True" />
                                                            <ClientEvents />
                                                        </ClientSettings>
                                                    </telerik:RadGrid>
                                                </div>
                                                <br />
                                            </asp:Panel>
                                        </div>
                                    </div>
                                </telerik:RadPageView>
                                <telerik:RadPageView ID="RadPageView2" runat="server">
                                    <table width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td>
                                                <asp:Panel ID="panelCommand" runat="server">
                                                    <div class="bigModulePaneFull">
                                                        <div class="bigModuleBottomPaneFull">
                                                            <table cellpadding="0" cellspacing="0">
                                                                <tr class="command-list">
                                                                    <td class="command-item" style="border: none">
                                                                        <asp:LinkButton ID="btnCollect" runat="server" CausesValidation="false" CssClass="LinkButton" onclick="btnCollect_Click">
                                                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;รวบรวมรายการ
                                                                        </asp:LinkButton>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>
                                                    </div>
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Panel ID="panel_Select" runat="server">
                                                    <div class="bigModulePaneFull" align="left">
                                                        <div class="bigModuleBottomPaneFull">
                                                            <asp:Panel ID="panelHeader_Select" runat="server">
                                                                <div class="header-grid">
                                                                    <asp:Label ID="Label1" runat="server" Text="แสดงเฉพาะรายการที่มีรายการพัสดุเหมือนกัน"></asp:Label>
                                                                </div>
                                                            </asp:Panel>
                                                            <asp:Panel CssClass="panelGridTab" ID="panelGrid_Select" runat="server" ScrollBars="Auto">
                                                                <div align="Left">
                                                                    <telerik:RadGrid CssClass="RadGrid" ID="Grid_Select" runat="server" AllowFilteringByColumn="True"
                                                                    AllowMultiRowSelection="True" AllowPaging="false" AllowSorting="True"
                                                                    AutoGenerateColumns="False" EnableAJAX="True" GridLines="None" Skin="Outlook" Width="95%"
                                                                    OnItemCommand="Grid_SelectCommand">
                                                                        <MasterTableView GroupLoadMode="Client" AllowMultiColumnSorting="true" DataKeyNames="InfoPprItem.Seq" ClientDataKeyNames="InfoPprItem.Seq" Width="100%">
                                                                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                                            <GroupHeaderItemStyle HorizontalAlign="Left" />
                                                                            <Columns>
                                                                                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                                                                                    <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                                </telerik:GridClientSelectColumn>
                                                                                <telerik:GridBoundColumn DataField="YearTypeDescr"
                                                                                    GroupByExpression="YearTypeDescr Group By InfoYearType.Seq, Year" Groupable="true" Visible="false"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" HeaderText="ประเภทปี" 
                                                                                    UniqueName="YearTypeDescr">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPurchaseRule.Name"
                                                                                    GroupByExpression="InfoPurchaseRule.Name Group By InfoPurchaseRule.Seq" Groupable="true" Visible="false"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" HeaderText="ระเบียบการจัดหา" 
                                                                                    UniqueName="InfoPurchaseRule.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPurchaseType.Name"
                                                                                    GroupByExpression="InfoPurchaseType.Name Group By InfoPurchaseType.Seq" Groupable="true" Visible="false"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" HeaderText="ประเภทการจัดหา" 
                                                                                    UniqueName="InfoPurchaseType.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoJobSite.Name"
                                                                                    GroupByExpression="InfoJobSite.Name Group By InfoJobSite.Seq" Groupable="true" Visible="false"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" HeaderText="หน่วยงาน" 
                                                                                    UniqueName="InfoJobSite.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="RefNoName"
                                                                                    GroupByExpression="RefNoName Group By Seq" Groupable="true" Visible="false"
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" HeaderText="รายการแจ้งความประสงค์" 
                                                                                    UniqueName="RefNoName">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="infoPprItem.InfoExpense.Name" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="รายจ่าย" 
                                                                                    UniqueName="infoPprItem.InfoExpense.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPprItem.Name" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="รายการพัสดุ" 
                                                                                    UniqueName="InfoPprItem.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPprItem.Descr" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="รายละเอียด" 
                                                                                    UniqueName="InfoPprItem.Descr">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPprItem.Qty" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" DataFormatString="{0:#,##0}"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="จำนวน" 
                                                                                    UniqueName="InfoPprItem.Qty">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Right" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoResourceMasterItem.InfoUnit.Name" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="หน่วย" 
                                                                                    UniqueName="InfoResourceMasterItem.InfoUnit.Name">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="infoPprItem.Price" 
                                                                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    FilterControlWidth="100%" DataFormatString="{0:#,##0.00}"
                                                                                    HeaderStyle-HorizontalAlign="Center" HeaderText="ราคาต่อ<br>หน่วย(บาท)" 
                                                                                    UniqueName="infoPprItem.Price">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Right" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPprItem.Seq" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoPprItem.Seq" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="Seq" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="Seq" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="Year" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="Year" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoYearType.Seq" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoYearType.Seq" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoJobSite.Seq" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoJobSite.Seq" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPurchaseType.Seq" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoPurchaseType.Seq" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPurchaseRule.Seq" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoPurchaseRule.Seq" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="InfoPprType.Seq" 
                                                                                    HeaderStyle-HorizontalAlign="Center" UniqueName="InfoPprType.Seq" 
                                                                                    Visible="false">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                </telerik:GridBoundColumn>
                                                                            </Columns>
                                                                        </MasterTableView>
                                                                        <ClientSettings EnableRowHoverStyle="true" >
                                                                            <Selecting AllowRowSelect="True" />
                                                                            <ClientEvents />
                                                                        </ClientSettings>
                                                                    </telerik:RadGrid>
                                                                </div>
                                                                <br />
                                                            </asp:Panel>
                                                        </div>
                                                    </div>
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                    </table>
                                </telerik:RadPageView>
                            </telerik:RadMultiPage>
                        </div>
                    </td>
                </tr>
            </table>
        </telerik:RadPane>
    </telerik:RadSplitter>
</asp:Content>
